package com.example.WEB;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class RegisterUserServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String userName=req.getParameter("userName");
        String password=req.getParameter("password");
        String nickName=req.getParameter("nickName");
        User user=new User(userName,password,nickName);
        UserDao userDao=new UserDao();
        try {
            userDao.operatingDatabase(user);
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}

